CC=/opt/toolchains/atom32-eglibc-std-2.12-gcc-4.5.1-binutils-2.20.1/bin/i686-fbx-linux-gnu-gcc
CXX=/opt/toolchains/atom32-eglibc-std-2.12-gcc-4.5.1-binutils-2.20.1/bin/i686-fbx-linux-gnu-g++

CFLAGS=-g -mfpmath=sse
CXXFLAGS=-g -mfpmath=sse

FREEBOX_SDK_PATH=/opt/toolchains/atom32-eglibc-std-2.12-gcc-4.5.1-binutils-2.20.1

INCLUDES=-I$(FREEBOX_SDK_PATH)/i686-fbx-linux-gnu/include \
		 	-I$(FREEBOX_SDK_PATH)/../gameloft_header/include \
			-I$(FREEBOX_SDK_PATH)/i686-fbx-linux-gnu/sys-root/usr/include

LDFLAGS=-L$(FREEBOX_SDK_PATH)/i686-fbx-linux-gnu/lib \
			-L$(FREEBOX_SDK_PATH)/../gameloft_header/lib \
			-L$(FREEBOX_SDK_PATH)/lib -lpthread

SRCS_cpp=$(wildcard *.cpp)
OBJS=$(SRCS_cpp:.cpp=.o)
SRCS_c=$(wildcard *.c)
OBJS+=$(SRCS_c:.c=.o)

OUT=sample


$(OUT) : $(OBJS)
	$(CXX) $(LDFLAGS) $(OBJS) -o $(OUT)

%.o : %.cpp
	$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@

%.o : %.c
	$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

clean :
	@rm -f *.o $(OUT)
	@echo all cleaned

.PHONY : clean
